package com.woniu.backparking.service.impl;

import com.woniu.backparking.dto.PageResult;
import com.woniu.backparking.entity.Complaint;
import com.woniu.backparking.mapper.ComplaintMapper;
import com.woniu.backparking.service.ComplaintService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 投诉表 服务实现类
 * </p>
 *
 * @author HashSong
 * @since 2021-07-09
 */
@Service
public class ComplaintServiceImpl extends ServiceImpl<ComplaintMapper, Complaint> implements ComplaintService {
    @Resource
    private ComplaintMapper complaintMapper;
    @Override
    public List<Complaint> select01(PageResult pageResult) {
        if(pageResult.getName01()==""){
            pageResult.setName01(null);
        }
        pageResult.setStart((pageResult.getCurrent()-1)*pageResult.getPageSize());
        pageResult.setEnd(pageResult.getCurrent()*pageResult.getPageSize());
        List<Complaint> complaints =complaintMapper.select01(pageResult);
        return complaints;
    }
}
